<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
<title>飞腾会-FitaClub</title>
<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>
</head>
<!-- end header -->

<body>
  <div class="page-group">
    <div class="page page-current bg-light-gray">
      <header class="bar bar-nav fita-header">
        <a href="javascript:history.back(-1);" class="icon icon-left pull-left"></a>
        <a href="${ctx.host}/cars/search" class="button pull-right">重选</a>
        <h1 class="title time-title">
          <div class="item">
            <p>${pickupLocation.cityName}</p>
            <span class="time">${carDetail.pickupDateTime}</span>
          </div>
          <div class="item day"><p class="no-margin">${days}天</p></div>
          <div class="item">
            <p>${returnLocation.cityName}</p>
            <span class="time">${carDetail.returnDateTime}</span>
          </div>
        </h1>
      </header>
      
      <div class="bar bar-footer fita-footer">
        <a href="javascript:void(0);" data-href="${ctx.host}/shopping/order" class="button userinfo-link">下一步</a>
      </div>
      
      <div class="content">
        <div class="list cars-list-layout">
          <div class="card fita-card">
            <div class="card-content">
              <div class="card-content-inner">
                <a href="">
                  <div class="car-title">
                  <c:choose>
                      <c:when test="${persist.modelGroups[carDetail.modelName] != null}">
                         ${persist.modelGroups[carDetail.modelName].chineseName}
                      </c:when>
                      <c:otherwise>
                        ${carDetail.modelName}
                      </c:otherwise>
                    </c:choose>
                  </div>
                  <div class="row no-gutter">
                    <div class="col-66 cars-type">
                      <c:choose>
                      <c:when test="${persist.modelGroups[carDetail.modelName] != null}">
                         <img src="${cloudContext.domain}/${persist.modelGroups[carDetail.modelName].picture}"/>
                      </c:when>
                      <c:otherwise>
                        <img src="${carDetail.picture}"/>
                      </c:otherwise>
                    </c:choose>
                      <p>
                      ${persist.getVehicleSize(carDetail.modelCodeClass).chineseName}/
                      ${persist.getVehicleCategory(carDetail.categoryCode).chineseName}/
                      ${carDetail.transmissionType eq 'MANUAL' ? '手动' : '自动'}/
                      ${carDetail.baggageQuantity}件行李/
                      ${carDetail.passengerQuantity}座位/
                      ${carDetail.airConditionIn ? '含空调' : '无空调'}/
                      ${carDetail.modelCodeType eq 'B' ? '2门' : car.modelCodeType eq 'C' ? '2或4门' : '4门或5门'}</p>
                    </div>
                    <div class="col-33 price-box" style="margin-bottom: 1.25rem;margin-top:.75rem;">
                      <c:set var="currentTotalAmount" value="${persist.generateCouponPrice(carDetail.totalAmount, carDetail.pickupLocation)}"/>
                      <c:choose>
                        <c:when test="${set.payType.arrivepay}">
                          <c:set var="exchangeRate" value="${persist.exchangeRate(carDetail.currencyCode)}"/>
                          <div class="item" style="margin-bottom: 1.25rem;">
                            <p>官方零售价：</p>
                            <p class="price"><span style="font-size: .75rem;">${exchangeRate.currencySymbol}</span><fmt:formatNumber value="${carDetail.retailAmount}" type="number" maxFractionDigits="2" pattern="0.00"/></p>
                          </div>
                          <div class="item" style="margin-bottom: 1.25rem;">
                            <p>返佣：</p>
                            <p class="price current-price"><span style="font-size: .75rem;">${exchangeRate.currencySymbol}</span><fmt:formatNumber value="${persist.agentCommission(carDetail.totalAmount, carDetail.pickupLocation, agentCompany.rate, agent.company.primaryAgentRate)}" type="number" maxFractionDigits="2" pattern="0.00"/></p>
                          </div>
                        </c:when>
                        <c:when test="${set.payType.floatPrepay || set.payType.dynamicPrepay}">
                          <div class="item" style="margin-bottom: 1.25rem;">
                            <p>官方零售价：</p>
                            <p class="price"><span style="font-size: .75rem;">￥</span><fmt:formatNumber value="${carDetail.retailAmount}" type="number" maxFractionDigits="2" pattern="0.00"/></p>
                          </div>
                          <div class="item" style="margin-bottom: 1.25rem;">
                            <p>浮动价：</p>
                            <p class="price current-price"><span style="font-size: .75rem;">￥</span><fmt:formatNumber value="${persist.dynamicPrepaid(currentTotalAmount, carDetail.currencyCode, agentCompany.rate, set.payType, agent.company.primaryAgentRate).setScale(0, 0)}" type="number" maxFractionDigits="2" pattern="0.00"/></p>
                          </div>
                        </c:when>
                        <c:otherwise>
                          <div class="item" style="margin-bottom: 1.25rem;">
                            <p>官方零售价：</p>
                            <p class="price"><span style="font-size: .75rem;">￥</span><fmt:formatNumber value="${carDetail.retailAmount}" type="number" maxFractionDigits="2" pattern="0.00"/></p>
                          </div>
                          <div class="item" style="margin-bottom: 1.25rem;">
                            <p>常规价：</p>
                            <p class="price current-price"><span style="font-size: .75rem;">￥</span><fmt:formatNumber value="${persist.prepaid(currentTotalAmount, carDetail.currencyCode, agentCompany.rate, agent.company.primaryAgentRate).setScale(0, 0)}" type="number" maxFractionDigits="2" pattern="0.00"/></p>
                          </div>
                        </c:otherwise>
                      </c:choose>
                    </div>
                  </div>
                </a>
              </div>
            </div>
          </div>
        </div>
        
        <form action="" method="POST" id="orderForm">
        <input type="hidden" name="countryId" value="${carDetail.countryId}">
        <input type="hidden" name="supplierId" value="${carDetail.supplierId}">
        <input type="hidden" name="type" value="${carDetail.type}">
        <input type="hidden" name="pickupLocation" value="${carDetail.pickupLocation}">
        <input type="hidden" name="returnLocation" value="${carDetail.returnLocation}">
        <input type="hidden" name="pickupDate" value="${carDetail.pickupDateString}">
        <input type="hidden" name="returnDate" value="${carDetail.returnDateString}">
        
        <input type="hidden" name="setId" value="${carDetail.setId}">
        <input type="hidden" name="doorCount" value="${carDetail.doorCount}">
        <input type="hidden" name="sizeCode" value="${carDetail.sizeCode}">
        <input type="hidden" name="categoryCode" value="${carDetail.categoryCode}">
        <input type="hidden" name="airConditionIn" value="${carDetail.airConditionIn}">
        <input type="hidden" name="transmissionType" value="${carDetail.transmissionType}">
        <input type="hidden" name="modelName" value="${carDetail.modelName}">
        <input type="hidden" name="modelCode" value="${carDetail.modelCode}">
        <input type="hidden" name="passengerQuantity" value="${carDetail.passengerQuantity}">
        <input type="hidden" name="baggageQuantity" value="${carDetail.baggageQuantity}">
        <input type="hidden" name="totalAmount" value="${carDetail.totalAmount}">
        <input type="hidden" name="esimatedTotalAmount" value="${carDetail.esimatedTotalAmount}">
        <input type="hidden" name="retailAmount" value="${carDetail.retailAmount}">
        <input type="hidden" name="currencyCode" value="${carDetail.currencyCode}">
        <input type="hidden" name="picture" value="${carDetail.picture}">
        <input type="hidden" name="specialEquipments" value="${carDetail.specialEquipments}">
        <input type="hidden" name="includeOrderFeeId" value="${carDetail.includeOrderFeeId}">
        <input type="hidden" name="unIncludeOrderFeeId" value="${carDetail.unIncludeOrderFeeId}">
        <input type="hidden" name="rateQualifier" value="${carDetail.rateQualifier}">
        <input type="hidden" name="vehicleChargeId" value="${carDetail.vehicleChargeId}">
        
        
        <div class="user-info">
          <div class="fita-block-title">
            <p class="no-margin">主驾人：</p>
            <span class="pull-right iconfont iconfont-down-arrow"></span>
          </div>
          <div class="box">
            <div class="item">
              <span>*姓氏<small class="color-gray">&nbsp;(拼音)</small>：</span>
              <input type="text" value="" name="firstName" onkeyup="value=value.replace(/[^\a-\z\A-\Z]/g,'')" style="text-transform: uppercase;"> 
            </div>
            <div class="item">
              <span>*名字<small class="color-gray">&nbsp;(拼音)</small>：</span>
              <input type="text" value="" name="lastName" onkeyup="value=value.replace(/[^\a-\z\A-\Z]/g,'')" style="text-transform: uppercase;"> 
            </div>
            <div class="item">
              <span>*手机号：</span>
              <input type="text" value="" name="userPhone"> 
            </div>
            <div class="item">
              <span>*邮箱：</span>
              <input type="text" value="" name="userEmail"> 
            </div>
            <div class="item">
              <span>*年龄：</span>
              <input type="text" value="${carDetail.driveAge}" name="driveAge" readonly> 
            </div>
            <div class="item">
              <span>航班号：</span>
              <input type="text" value="" name="airportNumber"> 
            </div>
          </div>
          
          <!-- <div style="margin: 1rem .5rem;font-weight: bold; font-size: .65rem; color: #fff;">
            <label>
              <input type="checkbox" name="" value="" style="display: inline-block; margin-top: .1rem;"/><span style="display: inline-block;margin-left: .25rem;vertical-align: top; color: #131313;">我需要开具发票<br>开具发票会增加3%的订单金额作为税点</span>
            </label>
          </div> -->
        </div>
      </form>
        
      </div>
      
      <!-- <div class="content">
        
       <p>用户信息填写页面</p>
        
        <a ctx.host="/shopping/shopping-orders-ack">订单确认页</a>
      </div> -->
    </div>
  </div>
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/shopping/user-info.js" />
  <script type="text/javascript">
    require(['page/shopping/user-info'], function(page) {
      page.init()
    })
  </script>
  
</body>
</html>